package com.yunbiao.ybbusstopplate.utils;

import java.util.Timer;

/**
 * 基本定时任务
 * @author  chenguangzou
 * @version 1.0
 * @date    2023/12/1 10:14
 */
public class BaseTimer{
   private Timer timer;

   public BaseTimer() {
      this.timer = new Timer();
   }

   public Timer getTimer() {
      if (timer == null) {
         timer  = new Timer();
      }
      return timer;
   }

   public void setTimer(Timer timer) {
      this.timer = timer;
   }

   public void cancelTimer() {
      if (timer != null) {
         timer.cancel();
         timer=null;
      }
   }
}
